package com.domespringcloudcosumer.controller;

import com.domespringcloudapi.entity.StudentEntity;
import com.domespringcloudapi.service.IStudent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
public class Studentcontroller {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping(path = "/getstudent")
    public List<StudentEntity> getStudent(){
        return  restTemplate.getForObject("http://DOMESPRINGCLOUD-PRIVIDER-8001/get",List.class);
    }
}
